FROM node:8-alpine

RUN npm install -g cnpm --registry=https://registry.npm.taobao.org &&\
    cnpm install -g gitbook-cli --save

COPY book.json /var/workspace/book.json

RUN gitbook install

WORKDIR /var/workspace

COPY . /var/workspace

EXPOSE 4000

CMD gitbook serve